#include<bits/stdc++.h>
#define int long long
#define pb push_back;
#define fi first;
#define se second;
using namespace std;
int n;
int va[200000];
signed main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);

    cin>>n;
    int small;
    int cnt=0;
    int s=0;
    for(int i=1;i<=n;i++)cin>>va[i];
    sort(va+1,va+1+n);
    for(int i=1;i<=n;i++)
    {
        if(s==0)
        {
            small=va[cnt+1];
            s++;
        }
        if(va[i]==small&&i!=1)s++;
        if(va[i]>small)
        {
            cnt++;
            s--;
        }
    }
    cout<<n-cnt;
    return 0;
}
